//
//  NSString+JwCode.h
//  JwPack
//
//  Created by 陈警卫 on 2024-07-16.
//

#import <Foundation/Foundation.h>

@interface NSString (JwCode)

/// 转data
- (NSData *)jw_data;

/// 转字典
- (NSDictionary *)jw_json;

/// MD5
- (NSString *)jw_md5String;

/// URL编码
- (NSString *)jw_urlEncode;

/// URL编码为NSURL
- (NSURL *)jw_urlEncodeUrl;

/// URL解码
- (NSString *)jw_urlDecode;

/// base64编码
- (NSString *)jw_base64Encode;

/// base64解码
- (NSString *)jw_base64Decode;

/// int转16进制字符串
+ (NSString *)jw_hexStringWithInt:(NSUInteger)value;

/// int转2进制字符串
+ (NSString *)jw_binaryStringWithInt:(NSInteger)value;

/// 判断是否16进制字符串
- (BOOL)jw_isHexString;

/// 16进制字符串转NSData
- (NSData *)jw_hexToData;

/// 16进制字符串转int
- (NSUInteger)jw_hexToInt;

/// 16进制字符串转2进制字符串
- (NSString *)jw_hexToBinaryString;

/// 判断是否2进制字符串
- (BOOL)jw_isBinaryString;

/// 2进制字符串转int
- (NSUInteger)jw_binaryToInt;

/// 2进制字符串转16进制字符串
- (NSString *)jw_binaryToHexString;

/// ASCII字符串转16进制字符串
- (NSString *)jw_asciiToHexString;

/// 转Int 4舍5入
- (NSInteger)jw_intRound;

/// 转Int 下取整
- (NSInteger)jw_intFloor;

/// 转Int 上取整
- (NSInteger)jw_intCeil;

@end
